package net.stevechaloner.idea.ffs.io;

import com.intellij.openapi.vfs.VirtualFileSystem;
import com.intellij.openapi.vfs.VirtualFileManager;

/**
 * @author Steve Chaloner
 */
public enum FileSystem
{
    FILE("file");

    /**
     * The name of the file system protocol
     */
    private final String name;

    FileSystem(String name)
    {
        this.name = name;
    }

    // javadoc unnecessary
    public String getName()
    {
        return name;
    }

    /**
     * Get the file system for the protocol.
     *
     * @return the file system
     */
    public VirtualFileSystem getFileSystem()
    {
        return VirtualFileManager.getInstance().getFileSystem(name);
    }
}
